package cn.neo.support.smartadapters.adapters;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;

import butterknife.ButterKnife;
import cn.neo.support.smartadapters.views.BindableLinearLayout4Percent;

/**
 * Name:百分比LinearLayout的BaseAdapter
 * Author: WK（wangkun@xjzhicheng.com)
 * Date: 2016-07-20
 * Describe: PLEASE TO FIXME...
 */
public abstract class BaseAdapterItemView4PLL<T> extends BindableLinearLayout4Percent<T> {
    public BaseAdapterItemView4PLL(Context context) {
        super(context);
    }

    public BaseAdapterItemView4PLL(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public BaseAdapterItemView4PLL(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }


    @Override
    public void onViewInflated() {
        ButterKnife.bind(this);
    }

    public void notifyItemAction(int actionId, T theItem, View view) {
        if (this.viewEventListener != null) {
            this.viewEventListener.onViewEvent(actionId, theItem, this.position, view);
        }

    }

    public void notifyItemAction(int actionId, View view) {
        this.notifyItemAction(actionId, this.item, view);
    }

    public void notifyItemAction(int actionId) {
        this.notifyItemAction(actionId, this.item, this);
    }
}
